package com.dbqn.zhao.util;

import com.dbqn.zhao.service.BaseService;
import com.dbqn.zhao.service.impl.*;

public class serviceFactory {


    //业务工厂类-------作用：帮忙创建对象

    //返回业务接口的实现类对象


    public static BaseService getService(String key){
        if("start".equals(key)){
            //创建功能选择实现类
            return (BaseService) new StartServesImpl();
        }else if("mail".equals(key)){
            //创建我要寄件实现类
            return (BaseService) new MailImpl();
        }else if("select".equals(key)){
            //创建查询订单实现类
            return (BaseService) new SelectImpl();
        }else if("update".equals(key)){
            //创建修改订单实现类
            return (BaseService) new UpdateImpl();
        }else if("delete".equals(key)){
            //创建取消订单实现类
            return (BaseService) new DeleteImpl();
        }else if("delete".equals(key)){
            //创建取消订单实现类
            return (BaseService) new DeleteImpl();
        }else if("select2".equals(key)){
            //创建取消订单实现类
            return (BaseService) new Select2IMpl();
        }



        return null;
    }


}
